package guoanmaker.operator.business.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.OperatorMessage;
import guoanmaker.operator.business.model.OperatorUserSignInActive;


public interface OperatorUserSignInActiveRepository extends  JpaRepository<OperatorUserSignInActive, String>, JpaSpecificationExecutor<OperatorUserSignInActive>{
	 @Query("select r from OperatorUserSignInActive r where r.signInStatus=:signInStatus")	
		public List<OperatorUserSignInActive>  selectByOperatorUserSignInActive(@Param("signInStatus") int signInStatus);
	 
	 @Query("select u from OperatorUserSignInActive u")
	 public Page<OperatorUserSignInActive> findByOperatorUserSignInActiveBypage(Pageable pageable);
	 @Query("select r from OperatorUserSignInActive r where r.signInStatus!=1")	
		public List<OperatorUserSignInActive>  selectByOperatorUserSignInActiveBystatus();
	 @Query("select r from OperatorUserSignInActive r where r.signInStatus=0")	
		public List<OperatorUserSignInActive>  selectByOperatorUserSignInActiveBystatusEnd();
	 
	 @Query("select u from OperatorUserSignInActive u where u.signInStatus!=1")
	 public Page<OperatorUserSignInActive> findOperatorUserSignInActiveBypageBystatus(Pageable pageable);
	 @Query("select u from OperatorUserSignInActive u order by signInEndTime desc")
	 public List<OperatorUserSignInActive> findOperatorUserSignInActiveBycreateDate();
}
